/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Control;

import java.awt.Shape;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

/**
 *
 * @author Eng Omnia
 */
public class Arrows {

    Shape curve;
    Shape firstArrow;
    Shape secondArrow;
    String equation = "no name";
    int index;
    Point2D peek;

    public Arrows() {
    }

    public void setCurve(Shape curve) {
        this.curve = curve;
    }

    public void setFirstArrow(Shape firstArrow) {
        this.firstArrow = firstArrow;
    }

    public void setSecondArrow(Shape secondArrow) {
        this.secondArrow = secondArrow;
    }

    public Shape getCurve() {
        return curve;
    }

    public Shape getFirstArrow() {
        return firstArrow;
    }

    public Shape getSecondArrow() {
        return secondArrow;
    }

    public void setEquation(String equation) {
        this.equation = equation;
    }

    public String getEquation() {
        return equation;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getIndex() {
        return index;
    }

    public boolean contains(Point2D p) {
//        Rectangle2D.Double v = (Rectangle2D.Double) curve.getBounds2D();
            Rectangle2D.Double v = (Rectangle2D.Double) getCurve().getBounds2D();
//int temp = getType(v., firstP);
                Rectangle2D.Double v2 = new Rectangle2D.Double(v.getCenterX(), v.getCenterY(), 5, 5);
        System.out.println(curve);
        //Rectangle2D.Double v2 = new Rectangle2D.Double(getPeek().getX(), getPeek().getY(), 10, 10);
        System.out.println(p);

        if (v2.contains(p)) {
            System.out.println("true");
            return true;
        }
        return false;
    }

    public void setPeek(Point2D peek) {
        this.peek = peek;
    }

    public Point2D getPeek() {
        return peek;
    }
}
